package com.dunqi.gpm.cangxi.home.activity;

import android.os.Bundle;
import android.support.design.widget.TabLayout;
import android.support.v4.app.Fragment;
import android.support.v4.view.ViewPager;

import com.dunqi.gpm.cangxi.R;
import com.dunqi.gpm.cangxi.common.base.BaseAct;
import com.dunqi.gpm.cangxi.common.view.ComTitleBar;
import com.dunqi.gpm.cangxi.home.adapter.ViewPagerFragmentAdapter;
import com.dunqi.gpm.cangxi.home.fragment.ProjectListFragment;

import java.util.ArrayList;

import butterknife.BindView;

public class AllProjectActivity extends BaseAct {


    @BindView(R.id.title_bar)
    ComTitleBar titleBar;
    @BindView(R.id.tab_layout)
    TabLayout tabLayout;
    @BindView(R.id.view_pager)
    ViewPager viewPager;
    ArrayList<Fragment> fragments = new ArrayList<>();
    String[] titles = {"全部项目", "十大事件", "重点项目"};

    @Override
    protected void refreshData(Bundle savedInstanceState) {

    }

    @Override
    protected void initUiAndListener() {
        fragments.add(new ProjectListFragment());
        fragments.add(new ProjectListFragment());
        fragments.add(new ProjectListFragment());
        viewPager.setAdapter(new ViewPagerFragmentAdapter(getSupportFragmentManager(), fragments, titles));
        tabLayout.setupWithViewPager(viewPager);
    }

    @Override
    protected int getLayoutId() {
        return R.layout.activity_all_project;
    }



}
